<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->


<title>Perfection</title>
<meta name="description" content="Perfection">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<link rel="STYLESHEET" href="acm-00382_archivos/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">
 <h1><br clear="ALL"><center><table bgcolor="#0060f0"><tbody><tr><td><b><font color="#c0ffff" size="5">&nbsp;<a name="SECTION0001000000000000000000">Perfection</a></font>&nbsp;</b></td></tr></tbody></table></center></h1>
<p>
From the article Number Theory in the 1994 Microsoft Encarta: ``If
<em>a</em>, <em>b</em>, <em>c</em> are integers such that <i>a</i> = <i>bc</i>, a is called a multiple of <em>b</em> or of
<em>c</em>, and <em>b</em> or <em>c</em> is called a divisor or factor of <em>a</em>. If <em>c</em> is not  <img alt="tex2html_wrap_inline41" src="acm-00382_archivos/382img1.gif" align="MIDDLE" height="24" width="20"> , <em>b</em> is
called a proper divisor of <em>a</em>. Even integers, which include 0, are
multiples of 2, for example, -4, 0, 2, 10; an odd integer is an
integer that is not even, for example, -5, 1, 3, 9. A perfect number
is a positive integer that is equal to the sum of all its positive,
proper divisors; for example, 6, which equals 1 + 2 + 3, and 28,
which equals 1 + 2 + 4 + 7 + 14, are perfect numbers. A positive
number that is not perfect is imperfect and is deficient or abundant
according to whether the sum of its positive, proper divisors is
smaller or larger than the number itself. Thus, 9, with proper
divisors 1, 3, is deficient; 12, with proper divisors 1, 2, 3, 4, 6, is
abundant."
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">Problem Statement</a></font></h2>
<p>
Given a number, determine if it is perfect,
abundant, or deficient.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">Input</a></font></h2>
<p>
A list of <i>N</i> positive integers (none greater than 60,000),
with 1 &lt; <i>N</i> &lt; 100. A 0 will mark the end of the list.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001003000000000000000">Output</a></font></h2>
<p>
The first line of output should read <tt>PERFECTION OUTPUT</tt>.  The next <i>N</i> lines of output should list for each input
integer whether it is perfect, deficient, or abundant, as shown in the
example below.  Format counts: the echoed integers should be
right justified within the first 5 spaces of the output line, followed
by two blank spaces, followed by the description of the integer. 
The final line of output should read <tt>END OF OUTPUT</tt>.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001004000000000000000">Sample Input</a></font></h2>
<p>
</p><pre>15 28 6 56 60000 22 496 0</pre>
<p>
</p><h2><font color="#0070e8"><a name="SECTION0001005000000000000000">Sample Output</a></font></h2>
<p>
</p><pre>PERFECTION OUTPUT
   15  DEFICIENT
   28  PERFECT
    6  PERFECT
   56  ABUNDANT
60000  ABUNDANT
   22  DEFICIENT
  496  PERFECT
END OF OUTPUT</pre>
<p>
</p></body></html>